package cn.gson.crm.controller.potential;

import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import cn.gson.crm.controller.BaseServlet;
import cn.gson.crm.model.dao.StudentDao;

/**
 * 分配学员
 */
@WebServlet("/allocation/stu")
public class AllocationStu extends BaseServlet {
	private static final long serialVersionUID = 1L;
	private StudentDao stuDao = new StudentDao();
       
	@Override
	protected void get(HttpServletRequest request, HttpServletResponse response) throws Exception {
		String[] sids = request.getParameterValues("sids");
		System.out.println("sids:"+sids.length);
		for (int i = 1; i < sids.length; i++) {
			//System.out.println(sids(i));
			stuDao.allocationStu("已分配", Integer.parseInt(sids[0]), Integer.parseInt(sids[i]));
		}
		redirect("potential");
	}

}
